package com.example.schedule;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wangbin
 */
@RestController
@RequestMapping("/schedule")
public class ScheduleController {
    @Resource
    private ScheduleService scheduleService;

    @GetMapping("/start/{scheduleId}")
    public void start(@PathVariable Integer scheduleId) {
        scheduleService.start(scheduleId);
    }

    @GetMapping("/stop/{scheduleId}")
    public void stop(@PathVariable Integer scheduleId) {
        scheduleService.stop(scheduleId);
    }
}
